package com.ruoyi.system.mapper;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.ruoyi.system.domain.SSubstationDevice;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 变电站设备信息Mapper接口
 * 
 * @author ruoyi
 * @date 2023-07-05
 */
public interface SSubstationDeviceMapper extends BaseMapper<SSubstationDevice>
{
    @Select("SELECT d.*,s.substation_name, dvl.device_voltage_level voltage_level_value FROM s_substation_device d " +
            "LEFT JOIN s_substation s on s.id = d.substation_id " +
            "LEFT JOIN s_device_voltage_level dvl on d.voltage_level = dvl.id ${ew.customSqlSegment}")
    List<SSubstationDevice> getList(@Param(Constants.WRAPPER) Wrapper<SSubstationDevice> queryWrapper);
}
